package model

import (
	"gorm.io/gorm"
)

type GrpcInstance struct {
	gorm.Model
	InstanceID  string `gorm:"column:instance_id;type:varchar(255);not null;uniqueIndex" json:"instance_id"`
	ModelInfoID uint   `gorm:"column:model_info_id;type:bigint;not null;uniqueIndex" json:"model_info_id"`
	ModelName   string `gorm:"column:model_name;type:varchar(255);not null;index" json:"model_name"`

	Status string `gorm:"column:status;type:varchar(20);not null;default:'pending';index" json:"status"`

	// 关联关系
	ModelInfo ModelInfo `gorm:"foreignKey:ModelInfoID" json:"model_info"`
}

func (g GrpcInstance) TableName() string {
	return "grpc_instance"
}
